import chalk from 'chalk';
import moment from 'moment';
const logger = Object.freeze({
    info: (...message: any[]) => {
        print(message, chalk.green)
    },
    sql: (...message: any[]) => {
        print(message, chalk.hex('#6f42c1').underline)
    },
    error: (...message: any[]) => {
        print(message, chalk.white.bgRed)
    },
    api: (...message: any[]) => {
        print(message, chalk.blue)
    },
    apiTitle: (...message: any[]) => {
        print(message, chalk.white.bgBlue)
    },
    request: (...message: any[]) => {
        print(message, chalk.white.bgBlue)
    }
})
const print = (msgs, printFn) => {
    let str = `\n[${moment(new Date()).format('yyyy-MM-DD HH:mm:ss')}] - `;
    msgs.forEach(e => {
        str = printFn(str) + printFn(e);
    });
    console.log(str)
}
export default logger;